/*
 * @Description:
 * @Author: 胡涛
 * @Date: 2023-10-12 22:15:55
 * @LastEditors: 胡涛
 * @LastEditTime: 2024-01-09 22:17:24
 */
import { AttachmentItemDto } from "../models";
import {
  FullAuditedAggregateRoot,
  PagedAndSortedResultRequestDto,
} from "../types";

/**
 * 企业信息
 */
export interface EnterpriseDto extends FullAuditedAggregateRoot<string> {
  code: string;
  name: string;
  enterpriseType: string;
  type: string;
  subType: string;
  businessCode: string;
  businessScope: string;
  attachments: Array<AttachmentItemDto>;
  registeredCapital: number;
  regionCode: string;
  address: string;
  email: string;
  site: string;
  conactName: string;
  phone: string;
  status: true;
  legalName: string;
  legalCardNo: string;
  legalPhone: string;
  accountNo: string;
  accountBankNo: string;
  accountBankName: string;
  description: string;
}

/**
 * 企业信息查询请求参数
 */
export interface GetEnterpriseInputDto extends PagedAndSortedResultRequestDto {
  Name: string;
  Type: string;
  Code: string;
  Status: boolean;
}

/**
 * 组织架构项数据
 */
export interface OrganizationDto extends FullAuditedAggregateRoot<string> {
  groupName: string;
  parentId: string;
  nodeType: StructureNodeType;
  name: string;
  pathCode: string;
  enCode: string;
  postName: string;
  depName: string;
  remarks: string;
  status: boolean;
}

/**
 * 组织架构树对象
 */
export interface OrganizationTreeDto extends OrganizationDto {
  children?: Array<OrganizationTreeDto>;
}

/**
 * 企业信息查询请求参数
 */
export interface GetOrganizationInputDto
  extends PagedAndSortedResultRequestDto {
  GroupName: string;
  Name: string;
  Code: string;
  ParentId: string;
  NodeType: StructureNodeType;
  Status: boolean;
}

/**
 * 	添加部门人员请求参数类
 */
export interface AddOrganizationUsersInputDto {
  organizationId: string;
  userIds: Array<string>;
  userItems: Array<AddDepartmentUserItem>;
}

export interface AddDepartmentUserItem {
  userId: string;
  postName: string;
}

export enum StructureNodeType {
  Group = 1,
  Region = 2,
  Enterprise = 4,
  Department = 8,
  Post = 16,
  User = 32,
  Team = 64,
}
